﻿using MongoDB.Bson;
using MongoDB.Driver;
using Sustainalytics.ClientDW.Entities.Universes;
using Sustainalytics.Entities;
using Sustainalytics.Entities.ScreeningTool;
using System;
using System.Collections.Generic;

namespace Sustainalytics.ScreeningTool.BL
{
    public interface IScreeningDataRepository
    {
        Dictionary<Guid, BsonDocument> GetScreeningDataDictionary(string[] fields, List<Guid> companyIds, bool hasISINClaim= false, bool hasCUSIPClaim = false);

        IEnumerable<double> LoadData(IEnumerable<int> universeIds, string criteriaEntityField);

        IEnumerable<Guid> Find(IEnumerable<int> universeIds, Func<FilterDefinitionBuilder<ScreeningData>, FilterDefinition<ScreeningData>> predicate);

        List<BsonDocument> GetCompaniesData(Filter filter, List<int> accountUniverseIds, List<Universe> accountUniverses, List<PortfolioDetails> portfolioDetails,
            List<FilterCriteria> filterCriteria, List<Guid> companiesInPorfolio, bool hasISINClaim, bool hasCUSIPClaim);

        List<BsonDocument> GetCompaniesData(List<PortfolioDetails> portfolioDetails, List<FilterCriteria> filterCriteria, FilterDefinition<ScreeningData> query, int skip, int take);

        FilterDefinition<ScreeningData> GetCompaniesQuery(Filter filter, List<int> accountUniverseIds, List<Universe> accountUniverses, List<Guid> companiesInPorfolio);

        List<BsonDocument> GetCompaniesDataAllAccounts(Filter filter, List<int> accountUniverseIds, List<Universe> accountUniverses, List<PortfolioDetails> portfolioDetails,
            List<FilterCriteria> filterCriteria, List<Guid> companiesInPorfolio, bool hasISINClaim, bool hasCUSIPClaim);

        List<BsonDocument> GetCompaniesForScreening(Filter filter, List<int> accountUniverseIds, List<Guid> companiesInPorfolio);

        List<BsonDocument> ListCriteriaResults(List<string> indicators, List<int> universeIds, Filter filter, List<Guid> companiesInPorfolio);
        
    }
}
